namespace Sirius.Mapper.Internals
{
    using System;
    using System.Data;

    internal class MultipleSet : IMultipleSet
    {
        private readonly IDataSource dataSource;

        public MultipleSet(IDataSource dataSource)
        {
            if (dataSource == null)
            {
                throw new ArgumentNullException("dataSource");
            }

            this.dataSource = dataSource;
        }

        public ISingleSet<T> NextSet<T>() 
            where T : new()
        {
            return dataSource.MoveNextSet() ? new SingleSet<T>(dataSource) : null;
        }

        public DataSet AsDataSet()
        {
            throw new NotImplementedException();
        }
    }
}